package com.baidu._04_TreeSet;

import java.util.Arrays;

/*
    数组排序
 */
public class Test05 {
    public static void main(String[] args) {
        String[] arr = {"aa", "b", "ccc"};
        Arrays.sort(arr, (s1, s2) -> s2.length() - s1.length() != 0 ? s2.length() - s1.length() : s2.compareTo(s1));
        System.out.println(Arrays.toString(arr));

        Double[] arr1 = {1.11, 2.1, 3.1, 4.15};
        //Arrays.sort(arr1, (s1, s2) -> Double.compare(s2, s1));
        Arrays.sort(arr1, Double::compare);
        System.out.println(Arrays.toString(arr1));
    }
}
